<?
	$seq = $param->getNumber('seq');
	if ($seq!="")
	{
		$db = GetDefaultConnection();
		$sql = sprintf("SELECT T_PRODUCT_TOTAL, "
						."(select JBNH_NAME FROM TB_JBNH WHERE JBNH_SEQ=a.JBNH_SEQ) as JBNH_NAME "
						.", (select FARM_NAME FROM TB_FARM WHERE FARM_SEQ=a.FARM_SEQ) as FARM_NAME "
						.", (select CODE_NAME FROM TB_CODE WHERE CODE_TYPE='A' AND CODE_CODE1=a.T_PRODUCT_ITEM1 AND CODE_CODE2=0) as ITEM1_NAME "
						.", (select CODE_NAME FROM TB_CODE WHERE CODE_TYPE='A' AND CODE_CODE1=a.T_PRODUCT_ITEM1 AND CODE_CODE2=a.T_PRODUCT_ITEM2) as ITEM2_NAME "
						." FROM TB_PRODUCT_TEMP a where T_PRODUCT_SEQ=%d", $seq);
		$list = $db->queryList($sql);

		if ($list != null)
		{
			$row = & $list->next();
			$jname = $row->getString('JBNH_NAME');
			$fname = $row->getString('FARM_NAME');
			$poitem1 = $row->getString('ITEM1_NAME');
			$poitem2 = $row->getString('ITEM2_NAME');
			$pototal = $row->getNumber('T_PRODUCT_TOTAL');
		}
	}
	$seq2 = $param->getNumber('seq2');
	if ($seq2!="")
	{
		$db = GetDefaultConnection();
		$sql = sprintf("SELECT * "
						." FROM TB_PRODUCT_RESULT a where R_PRODUCT_SEQ=%d", $seq2);

		$list = $db->queryList($sql);

		if ($list != null)
		{
			$row = & $list->next();
			$odate = $row->getString('R_PRODUCT_DATE');
			$ocountry = $row->getString('R_PRODUCT_COUNTRY');
			$ograde2 = $row->getString('R_PRODUCT_GRADE2');
			$ostandard2 = $row->getString('R_PRODUCT_STANDARD2');
			$oweight2 = $row->getString('R_PRODUCT_WEIGHT2');
			$onumber = $row->getString('R_PRODUCT_NUMBER');
			$oloss = $row->getString('R_PRODUCT_LOSS');
			$ototal = $row->getNumber('R_PRODUCT_TOTAL');
		}
	}
	$ndate = ($odate=="") ? date('Y-m-d') : $odate;

?>